package com.steel.yfmall.cloud.assistant.controller;

import com.alibaba.fastjson.JSON;
import com.steel.yfmall.cloud.assistant.api.stock.CancelOrderServiceAPI;
import com.steel.yfmall.cloud.assistant.bean.param.APIParamCancelOrderBean;
import com.steel.yfmall.cloud.components.utils.base.APIMsgBean;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @program: CancelOrderController
 * @author: liuzhijun
 * @date: 2021-04-05 15:31
 **/
@RestController
@Slf4j
public class CancelOrderController {


    /**
     * 苍穹调用助手服务取消订单 (临时启用)
     * @param apiParaBean
     * @author liuzhijun
     * @date 2021/4/5 20:01 
     * @return com.steel.yfmall.cloud.components.utils.base.APIMsgBean<java.lang.Boolean>
     */
   @RequestMapping(value = "cancelOrder")
   public APIMsgBean<Boolean> cancelOrder(@RequestBody APIParamCancelOrderBean apiParaBean) {
        if (log.isDebugEnabled()) {
            log.info("function cancelOrder :" + JSON.toJSONString(apiParaBean));
        }
        return cancelOrderServiceAPI.cancelOrder(apiParaBean);
    }

    @Resource
    private CancelOrderServiceAPI cancelOrderServiceAPI;
}
